home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1994 November / Cd Ware (Nro. 2) - Epimundo.iso / DOS / PG / CLIP.ZIP / CLIPBRD.ASM < prev    next >
Encoding:
Assembly Source File  |  1994-05-06  |  2.8 KB  |  133 lines

  1. %TITLE "ASSEMBLY MODULE FOR CLIPBOARD INTERACTION by David B. Symolon"
  2. ;
  3. ;    Clipbrd.h has all the C prototypes for these functions.
  4. ;
  5. ;
  6. ;If a function returns an -int- that means it will return 0 if unsuccessful
  7. ;    a non-zero value if it is - except if otherwise noted!
  8. ;
  9.     .MODEL    small
  10.     .CODE
  11.     PUBLIC _WinOldApp,_OpenClipBoard,_ClearClipBoard,_CopyToClip,_QueryClip,
  12.     PUBLIC _PasteFrmClip,_CloseClip,_CompactClip    
  13.  
  14.  
  15. ;**************** int WinOldApp( void ) *****************************
  16. ; NOTE: returns version; otherwise returns 1700h if Clip not supported
  17. ;
  18. _WinOldApp     PROC
  19.     push    bp
  20.     mov    bp,sp        ;Local stack frame
  21.     mov    ax,1700h    ;function call
  22.     int 2fh            ;multiplex interupt
  23.     cmp     ax,1700h
  24.     jnz    ver
  25.     sub    ax,ax        ;return 0=FALSE
  26. ver:
  27.     pop    bp
  28.     ret
  29. _WinOldApp     ENDP
  30.  
  31. ;************* int OpenClipBoard( void ) ****************************
  32.  
  33. _OpenClipBoard     PROC
  34.     mov    ax,1701h
  35.     int 2fh
  36.     ret
  37. _OpenClipBoard    ENDP
  38.  
  39. ;************* int ClearClipBoard( void ) *****************************
  40.  
  41. _ClearClipBoard    PROC
  42.     mov    ax,1702h
  43.     int 2fh
  44.     ret
  45. _ClearClipBoard    ENDP
  46.  
  47. ;************ int CopyToClip( int <format code>,*******************
  48. ;    unsigned long <length of data (bytes), void far*<ptr to data> )
  49. ;
  50. ;Format codes:
  51. ;    1    text - Windows
  52. ;    2    Bitmap
  53. ;    3    Metafile
  54. ;    4    SYLK    Excel Format
  55. ;    5    DIF    Standard data interchange
  56. ;    6    TIFF    Tagged image File(graphics)
  57. ;    7    OEM    Text(Using the PC text) -*! use with DOS *
  58. ;    81H    DSP Text TEXT
  59. ;    82H    DSP Bitmap
  60. ;-------------------------------------------------------------------
  61. _CopyToClip    PROC
  62.     push bp
  63.     mov     bp,sp
  64.     push si
  65.     mov    ax,1703h
  66.     mov    dx,[bp+4]    ;format code
  67.     mov    si,word ptr[bp+8]    ;length of data
  68.     mov    cx,word ptr[bp+6]
  69.     les    bx,[bp+10]    ;pointer to data
  70.     int 2fh            ;make the call
  71.     pop si
  72.     pop bp
  73.     ret
  74. _CopyToClip    ENDP
  75. ;
  76. ;    SEE format codes above...
  77. ;
  78. ;******************* *long QueryClip( int <format code> )***********
  79. ;
  80. _QueryClip    PROC
  81.     push    bp
  82.     mov    bp,sp
  83.     mov    ax,1704h
  84.     mov    dx,[bp+4]
  85.     int 2fh
  86.     pop    bp
  87.     ret
  88. _QueryClip    ENDP
  89.  
  90. ;*********** int PasteFrmClip(int <format code>, PVOID <buffer> ) ****
  91. ;
  92. _PasteFrmClip    PROC
  93.     push    bp
  94.     mov        bp,sp
  95.     mov    ax,1705h
  96.     mov    dx,[bp+4]
  97.     les    bx,[bp+6]
  98.     int 2fh
  99.     pop        bp
  100.     ret
  101. _PasteFrmClip    ENDP
  102. ;
  103. ;************* int    CloseClip( void )* ******************************
  104. _CloseClip    PROC
  105.     mov    ax,1708h
  106.     int 2fh
  107. _CloseClip    ENDP
  108. ;
  109. ;*************  *long    CompactClip( int <required size in bytes> ) ****
  110. _CompactClip    PROC
  111.     push    bp
  112.     mov        bp,sp
  113.     push    ds              ; Had to save all the regs
  114.     push    es              ; Func-1709 messed them all up!
  115.     push    ss
  116.     push    di
  117.     push    si
  118.  
  119.     mov    ax,1709h
  120.     mov    si,word ptr[bp+6]   ; Required size in bytes
  121.     mov    cx,word ptr[bp+4]   ;
  122.     int 2fh
  123.  
  124.     pop    si
  125.     pop    di
  126.     pop    ss
  127.     pop es
  128.     pop ds
  129.     pop    bp
  130.     ret
  131. _CompactClip    ENDP
  132.  
  133.     END